package com.dyz.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "authorization-server")
public interface Oauth2FeignClient {
    @PostMapping("/oauth/token")
    ResponseEntity<JwtToken> getToken(
           @RequestParam("grant_type") String grantType,
           @RequestParam("username") String username,
           @RequestParam("password") String password,
           @RequestParam("login_type") String loginType,
           @RequestHeader ("Authorization") String basicToken // Basic base64(clientId:clientSecret) 由第三方客户端提供
    );
}
